#include <iostream>
using namespace std;
const int N = 2010;
int n;
int arr[N];
 
int bfs()
{
    int left = 1, right = 1;
    int ret = 0;
    while(left <= right)
    {
        ++ret;
        int r = right;
        for(int i = left; i <= right; ++i)
        {
            r = max(r, arr[i] + i);
            if(r >= n)
                return ret;
        }
        left = right + 1;
        right = r;
    }
    return -1;
}
 
int main()
{
    cin >> n;
    for(int i = 1; i <= n; ++i)
    {
        cin >> arr[i];
    }
    cout << bfs() << endl;
    return 0;
}